<?php

class CBase {
	
	protected $_basePath = "";
	
	function __construct(){
		$this->_basePath = __DIR__."/../../";
	}
	
	/**
	 * 根据目录返回绝对路径
	 * @param string $dir
	 */
	protected function getAbsolutePath($dir)
	{
		$dir = str_replace("\\","/",$dir);
		
		if(substr($dir,0,1)=="/")
		{
			$dir = substr($dir,1,strlen($dir)-1);
		}
		
		if(substr($dir,strlen($dir)-1,1)!="/")
		{
			$dir .= "/";
		}
		
		return $this->_basePath.$dir;
	}
}

?>